import { ApiProperty } from '@nestjs/swagger';
 
interface IPageMeta {
  pageNum: number;
  pageSize: number;
  total: number;
}
export class PageDto<T> {
  @ApiProperty({ isArray: true })
  readonly data: T[];

  @ApiProperty()
  readonly pageNum: number;
  @ApiProperty()
  readonly pageSize: number;
  @ApiProperty()
  readonly total: number;

  constructor(data: T[], {pageNum,pageSize,total}:IPageMeta) {
    this.data = data;
    this.pageNum = pageNum;
    this.pageSize = pageSize;
    this.total = total;
  }
}
